package com.baikeyang.common.model;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author BaiKeyang
 * @since 2020-05-20
 */
@TableName("t_activity_info")
public class ActivityInfo extends Model<ActivityInfo> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "ID", type = IdType.AUTO)
    private Integer id;

    /**
     * 名称
     */
    @TableField("NAME")
    private String name;

    /**
     * 主题
     */
    @TableField("TITLE")
    private String title;

    /**
     * 标签
     */
    @TableField("TAG")
    private String tag;

    /**
     * 出发地
     */
    @TableField("DEPARTURE")
    private String departure;

    /**
     * 目的地
     */
    @TableField("DESTINATION")
    private String destination;

    /**
     * 内容
     */
    @TableField("CONTENT")
    private String content;

    /**
     * 出发时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("START_TIME")
    private Date startTime;

    @TableField(exist = false)
    private String startTimeStr;

    /**
     * 结束时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("END_TIME")
    private Date endTime;

    @TableField(exist = false)
    private String endTimeStr;

    /**
     * 出行方式
     */
    @TableField("TRAVEL_MODE")
    private String travelMode;

    /**
     * 人数上限
     */
    @TableField("MAXIMUM_PEOPLE")
    private Integer maximumPeople;

    /**
     * 是否产生费用
     */
    @TableField("IS_COST")
    private Integer isCost;

    /**
     * 活动费用
     */
    @TableField("COST")
    private Double cost;

    /**
     * 活动类型
     */
    @TableField("TYPE")
    private Integer type;

    /**
     * 集合点
     */
    @TableField("MEETING_PLACE")
    private Integer meetingPlace;

    /**
     * 集合时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("MEETING_TIME")
    private Date meetingTime;

    @TableField(exist = false)
    private String meetingTimeStr;

    /**
     * 途径位置
     */
    @TableField("PATH_WAYS")
    private String pathWays;

    /**
     * 发布时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("RELEASE_TIME")
    private Date releaseTime;

    @TableField(exist = false)
    private String releaseTimeStr;

    /**
     * 发布人
     */
    @TableField("RELEASE_USER")
    private Long releaseUser;

    /**
     * 创建人
     */
    @TableField("CREATE_USER")
    private Long createUser;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("CREATE_TIME")
    private Date createTime;

    /**
     * 更新人
     */
    @TableField("UPDATE_USER")
    private Long updateUser;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("UPDATE_TIME")
    private Date updateTime;

    /**
     * 状态
     */
    @TableField("STATE")
    private Integer state;

    @TableField("MEETING_PLACE_ADDRESS")
    private String meetingPlaceAddress;

    @TableField("IS_REGISTER")
    private String isRegister;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("REGISTER_START_TIME")
    private Date registerStartTime;

    @TableField(exist = false)
    private String registerStartTimeStr;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("REGISTER_END_TIME")
    private Date registerEndTime;

    @TableField(exist = false)
    private String registerEndTimeStr;

    @TableField("COVER_IMG")
    private String coverImg;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getDeparture() {
        return departure;
    }

    public void setDeparture(String departure) {
        this.departure = departure;
    }

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
        if(null != startTime){
            this.startTimeStr = DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss");
        }
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
        if(null != endTime){
            this.endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
        }
    }

    public String getTravelMode() {
        return travelMode;
    }

    public void setTravelMode(String travelMode) {
        this.travelMode = travelMode;
    }

    public Integer getMaximumPeople() {
        return maximumPeople;
    }

    public void setMaximumPeople(Integer maximumPeople) {
        this.maximumPeople = maximumPeople;
    }

    public Integer getIsCost() {
        return isCost;
    }

    public void setIsCost(Integer isCost) {
        this.isCost = isCost;
    }

    public Double getCost() {
        return cost;
    }

    public void setCost(Double cost) {
        this.cost = cost;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getMeetingPlace() {
        return meetingPlace;
    }

    public void setMeetingPlace(Integer meetingPlace) {
        this.meetingPlace = meetingPlace;
    }

    public Date getMeetingTime() {
        return meetingTime;
    }

    public void setMeetingTime(Date meetingTime) {
        this.meetingTime = meetingTime;
        if(null != meetingTime){
            this.meetingTimeStr = DateUtil.format(meetingTime, "yyyy-MM-dd HH:mm:ss");
        }
    }

    public String getPathWays() {
        return pathWays;
    }

    public void setPathWays(String pathWays) {
        this.pathWays = pathWays;
    }

    public Date getReleaseTime() {
        return releaseTime;
    }

    public void setReleaseTime(Date releaseTime) {
        this.releaseTime = releaseTime;
        if(null != releaseTime){
            this.releaseTimeStr = DateUtil.format(releaseTime, "yyyy-MM-dd HH:mm:ss");
        }
    }

    public Long getReleaseUser() {
        return releaseUser;
    }

    public void setReleaseUser(Long releaseUser) {
        this.releaseUser = releaseUser;
    }

    public Long getCreateUser() {
        return createUser;
    }

    public void setCreateUser(Long createUser) {
        this.createUser = createUser;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(Long updateUser) {
        this.updateUser = updateUser;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "ActivityInfo{" +
        "id=" + id +
        ", name=" + name +
        ", title=" + title +
        ", tag=" + tag +
        ", departure=" + departure +
        ", destination=" + destination +
        ", content=" + content +
        ", startTime=" + startTime +
        ", endTime=" + endTime +
        ", travelMode=" + travelMode +
        ", maximumPeople=" + maximumPeople +
        ", isCost=" + isCost +
        ", cost=" + cost +
        ", type=" + type +
        ", meetingPlace=" + meetingPlace +
        ", meetingTime=" + meetingTime +
        ", pathWays=" + pathWays +
        ", releaseTime=" + releaseTime +
        ", releaseUser=" + releaseUser +
        ", createUser=" + createUser +
        ", createTime=" + createTime +
        ", updateUser=" + updateUser +
        ", updateTime=" + updateTime +
        ", state=" + state +
        "}";
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getStartTimeStr() {
        return startTimeStr;
    }

    public void setStartTimeStr(String startTimeStr) {
        this.startTimeStr = startTimeStr;
        if(StrUtil.isNotEmpty(startTimeStr) && null != DateUtil.parse(startTimeStr, "yyyy-MM-dd HH:mm:ss")){
            setStartTime(DateUtil.parse(startTimeStr, "yyyy-MM-dd HH:mm:ss"));
        }
    }

    public String getEndTimeStr() {
        return endTimeStr;
    }

    public void setEndTimeStr(String endTimeStr) {
        this.endTimeStr = endTimeStr;
        if(StrUtil.isNotEmpty(endTimeStr) && null != DateUtil.parse(endTimeStr, "yyyy-MM-dd HH:mm:ss")){
            setEndTime(DateUtil.parse(endTimeStr, "yyyy-MM-dd HH:mm:ss"));
        }
    }

    public String getMeetingPlaceAddress() {
        return meetingPlaceAddress;
    }

    public void setMeetingPlaceAddress(String meetingPlaceAddress) {
        this.meetingPlaceAddress = meetingPlaceAddress;
    }

    public String getMeetingTimeStr() {
        return meetingTimeStr;
    }

    public void setMeetingTimeStr(String meetingTimeStr) {
        this.meetingTimeStr = meetingTimeStr;
        if(StrUtil.isNotEmpty(meetingTimeStr) && null != DateUtil.parse(meetingTimeStr, "yyyy-MM-dd HH:mm:ss")){
            setMeetingTime(DateUtil.parse(meetingTimeStr, "yyyy-MM-dd HH:mm:ss"));
        }
    }

    public String getReleaseTimeStr() {
        return releaseTimeStr;
    }

    public void setReleaseTimeStr(String releaseTimeStr) {
        this.releaseTimeStr = releaseTimeStr;
        if(StrUtil.isNotEmpty(releaseTimeStr) && null != DateUtil.parse(releaseTimeStr, "yyyy-MM-dd HH:mm:ss")){
            setReleaseTime(DateUtil.parse(releaseTimeStr, "yyyy-MM-dd HH:mm:ss"));
        }
    }

    public String getIsRegister() {
        return isRegister;
    }

    public void setIsRegister(String isRegister) {
        this.isRegister = isRegister;
    }

    public Date getRegisterStartTime() {
        return registerStartTime;
    }

    public void setRegisterStartTime(Date registerStartTime) {
        this.registerStartTime = registerStartTime;
        if(null != registerStartTime){
            this.registerStartTimeStr = DateUtil.format(registerStartTime, "yyyy-MM-dd HH:mm:ss");
        }
    }

    public Date getRegisterEndTime() {
        return registerEndTime;
    }

    public void setRegisterEndTime(Date registerEndTime) {
        this.registerEndTime = registerEndTime;
        if(null != registerEndTime){
            this.registerEndTimeStr = DateUtil.format(registerEndTime, "yyyy-MM-dd HH:mm:ss");
        }
    }

    public String getCoverImg() {
        return coverImg;
    }

    public void setCoverImg(String coverImg) {
        this.coverImg = coverImg;
    }

    public String getRegisterStartTimeStr() {
        return registerStartTimeStr;
    }

    public void setRegisterStartTimeStr(String registerStartTimeStr) {
        this.registerStartTimeStr = registerStartTimeStr;
        if(StrUtil.isNotEmpty(registerStartTimeStr) && null != DateUtil.parse(registerStartTimeStr, "yyyy-MM-dd HH:mm:ss")){
            this.registerStartTime = DateUtil.parse(registerStartTimeStr, "yyyy-MM-dd HH:mm:ss");
        }
    }

    public String getRegisterEndTimeStr() {
        return registerEndTimeStr;
    }

    public void setRegisterEndTimeStr(String registerEndTimeStr) {
        this.registerEndTimeStr = registerEndTimeStr;
        if(StrUtil.isNotEmpty(registerEndTimeStr) && null != DateUtil.parse(registerEndTimeStr, "yyyy-MM-dd HH:mm:ss")){
            this.registerEndTime = DateUtil.parse(registerEndTimeStr, "yyyy-MM-dd HH:mm:ss");
        }
    }
}
